<!--
 * @Date         : 2024-03-01 20:29:20
 * @LastEditTime : 2024-03-10 16:52:15
 * @description  : 
-->
<script setup>
import { getExamInfo, trainLog } from "@/api";
import { onMounted } from "vue";
import { useRoute } from "vue-router";
import Header from "../components/Header.vue";
const list = ref([]);
const route = useRoute();
const getData = () => {
  let { id } = route.query;
  trainLog({ prescription_id: id }).then((res) => {
    list.value = res.data;
  });
};
onMounted(() => {
  getData();
});
</script>

<template>
  <div class="Notice">
    <Header title="练习记录" :isHideRight="false" :isShowBack="true" />
    <div class="main">
      <!-- {{ list }} -->
      <el-table :data="list" style="width: 100%" empty-text="暂无练习记录">
        <el-table-column type="index" width="80" align="center" />
        <el-table-column prop="title" label="题目" align="center" />
        <el-table-column label="结果" width="180" align="center">
          <template #default="scope">
            <el-tag :type="scope.row.status === 1 ? 'primary' : 'danger'">
              {{ scope.row.status == 1 ? "正确" : "错误" }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          prop="update_time"
          label="时间"
          width="180"
        />
      </el-table>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.Notice {
  background: #855c4c;
  box-sizing: border-box;
  height: 100vh;
  overflow: auto;
  min-width: 100vw;
  .main {
    overflow: hidden;
    margin: 0 10px 10px 10px;
    border-radius: 10px;
    background: #f6eee8;
    box-sizing: border-box;
    height: 88vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    .title {
      font-size: 21px;
      color: #652e1b;
      text-align: center;
      padding: 20px;
    }
    .notice-txt {
      flex: 1;
      .text {
        color: #666666;
        font-size: 16px;
      }
    }
    .bottom {
      display: flex;
      justify-content: center;
    }
  }
}
</style>
